<?php

namespace Database\Factories;

use App\Models\Admin;
use App\Models\Role;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Admin>
 */
class AdminFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'phone' => fake()->phoneNumber(),
            'email' => fake()->unique()->safeEmail(),
            'avatar' => fake()->imageUrl(300, 300),
            'username' => fake()->name(),
            'balance' => fake()->randomFloat(2, 0, 100),
            // 'admin_id' => Admin::inRandomOrder()->first()->id,
            'role_id' => Role::inRandomOrder()->first()->id,
            'status' => 1,
            'password' => Hash::make('123456'),
        ];
    }
}
